<template>
  <el-container class="home-container">
    <el-header height="45px" style="margin-bottom: 0px">
        <el-link target="_blank">Just Keep Going ~lazyzw</el-link>
        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect" router>
            <el-menu-item index="/homepage">首页</el-menu-item>
            <el-menu-item index="/archive">归档</el-menu-item>
            <el-menu-item index="/type">分类</el-menu-item>
            <el-menu-item index="/tag">标签</el-menu-item>
            <el-menu-item index="/message">留言板</el-menu-item>
            <el-menu-item index="/introduce">About Me</el-menu-item>
            <el-menu-item index="/friend">朋友</el-menu-item>
        </el-menu>
        <el-input placeholder="请输入内容" v-model="keyword" class="input-with-select" >
            <el-button @click="search" slot="append" icon="el-icon-search"></el-button>
        </el-input>
    </el-header>
    <el-main>
        <router-view></router-view>
        <div class="footer">
          <el-link target="_blank" class="footer-link" :underline="false" href="#">©2021 Designed ByWengzw 粤ICP备20210425号-1</el-link>
        </div>
    </el-main>
  </el-container>
</template>

<script>
export default {
  data () {
    return {
      keyword: '',
      activeIndex: '/homepage',
      isLogin: false
    }
  },
  methods: {
    handleSelect (key, keyPath) {
    },
    search () {
      this.$router.push({ name: 'searchlist', params: { keyword: this.keyword } })
    }
  }
}
</script>

<style lang="less" scoped>
.home-container {
  height: 100%;
}
.el-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.el-input {
  width: 450px;
}
.el-button {
  padding: 12px 11px;
}
.el-menu--horizontal>.el-menu-item {
    float: left;
    height: 45px;
    line-height: 45px;
    margin: 0;
    border-bottom: 2px solid transparent;
    color: #909399;
}
.el-main {
  background-color: #eaedf1;
  padding: 0px;
}
.el-menu {
  margin-left: -10%;
}
.el-link {
  margin-left: 2%;
}
.footer{
  text-align: center;
}
.footer-link{
  margin-top: 20px;
  margin-bottom: 20px;
}

</style>
